﻿{% extends "app/layout.html" %}
{% block content %}
<div class="page-header">
    <h1>作业列表 <small>业精于勤，荒于嬉；行成于思，毁于随。</small></h1>
    <div role="alert" class="alert alert-success"><span><strong>消息</strong> 共发布习题 {{ qc }} 个，测试通过 {{ qac }} 个。 </span></div>
</div>
<div role="tablist" aria-multiselectable="true" class="panel-group" id="accordion-1">
{% for w in works %}
    <div class="panel panel-default">
        <div role="tab" class="panel-heading">
            <h4 class="panel-title"><a role="button" data-toggle="collapse" aria-expanded="true" data-parent="#accordion-1" href="#">{{ w.h.title }}</a> <small>{{ w.h.start_time|date:'Y-n-d' }} —— {{ w.h.end_time|date:'Y-n-d' }}</small></h4>
        </div>
        <div role="tabpanel" class="panel-collapse collapse in item-1">
            <ol>
            {% for p in w.ps %}
                <li><a href="{% url 'question' %}?pid={{ p.id }}">
                    {{ p.title }}
                        <span class="badge pull-right badge-success">{{ p.submission_number }} / {{ p.accepted_number }}</span>
                        <span class="badge pull-right badge-warning">{{ p.difficulty }}</span>
                        <span class="badge pull-right badge-error">{{ p.create_time|date:'Y-n-d' }}</span>
                        <span class="badge pull-right badge-info">{{ p.submission }}</span>
                </a></li>
            {% endfor %}
            </ol>
        </div>
    </div>
{% endfor %}
</div>
{% endblock %}
